package com.eliza.springboot.v3.config.condition

import com.eliza.springboot.v3.model.Greeting
import org.springframework.boot.SpringBootConfiguration
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
import org.springframework.context.annotation.Bean

//@ConditionalOn
@SpringBootConfiguration
class ConditionalO {

    @Bean
    @ConditionalOnClass(Greeting::class)
    fun hasGreeting(): Greeting {
        return Greeting(0, "")
    }
}